<?php
	require "../dao/staff_dao.php";
	
	session_start();
	$student_roll_infor = $_SESSION["student_roll_infor"];

?>
<!DOCTYPE html>
<html lang="zh">
<head>
	<meta charset="UTF-8" />
	<meta name="viewport" content="width=device-width, initial-scale=1.0" />
	<meta http-equiv="X-UA-Compatible" content="ie=edge" />
	<link rel="stylesheet" href="../css/select_infor.css" />
	<script src="../js/jquery-1.2.6.min.js"></script>
	<title>学生信息</title>
</head>
<body>
	<div id="wrap" style="width:2000px;">
		<table id="tbl">
			<caption>
				<h3>学生学籍表</h3>
			</caption>
			<thead>
				<tr>
					<th>编号</th>
					<th>姓名</th>
					<th>学号</th>
					<th>密码</th>
					<th>性别</th>
					<th>年制</th>
					<th>入学时间</th>
					<th>毕业时间</th>
					<th>出生日期</th>
					<th>证件号码</th>
					<th>籍贯</th>
					<th>学院</th>
					<th>年级</th>
					<th>班级</th>
					<th>简介</th>
					<th>操作</th>
				</tr>
			</thead>
			<tbody>
				<?php
					for($i=0;$i<count($student_roll_infor);$i++){
						$student_i = $student_roll_infor[$i];
				?>
						<tr>
							<td><?=$i+1?></td>
							<td><?=$student_i["sname"]?></td>
							<td><?=$student_i["snumber"]?></td>
							<td><?=$student_i["spass"]?></td>
							<td><?=$student_i["ssex"]?></td>
							<td><?=$student_i["ssys"]?></td>
							<td><?=$student_i["senter"]?></td>
							<td><?=$student_i["sgrad"]?></td>
							<td><?=$student_i["sbirth"]?></td>
							<td><?=$student_i["sidnumber"]?></td>
							<td><?=$student_i["snative"]?></td>
							<td><?=$student_i["collegename"]?></td>
							<td><?=$student_i["gradename"]?></td>
							<td><?=$student_i["classname"]?></td>
							<td><?=$student_i["sdesc"]?></td>
							<td>
								<a href="" class='btn' id="del_btn">删除</a>
								<a href="../Update/Stu_roll_update.php?stuid=<?=$student_i['stuid']?>" class='btn'>修改</a>
							</td>
						</tr>
				<?php
					}	
				?>
			</tbody>
		</table>
	</div>
	<script type="text/javascript">
		let DelBtn = document.querySelectorAll("#del_btn");
		<?php
			for($i=0;$i<count($student_roll_infor);$i++){
				$student_i = $student_roll_infor[$i];
		?>
				DelBtn[<?=$i?>].onclick = function(){
					var r = window.confirm("是否删除");
					if(r == true){
						DelBtn[<?=$i?>].href = "../Delete/Stu_roll_delete.php?stuid=<?=$student_i['stuid']?>";
					}
				}
		<?php
			}	
		?>
		
	</script>
</body>
</html>